"use strict";
module.exports = {
  /**
   * 删除分类
   * @url client/classification/kh/deleteClassification 前端调用的url参数地址
   * data 请求参数
   * @param {String} params1  参数1
   */
  main: async (event) => {
    let { data = {}, userInfo, util, filterResponse, originalParam } = event;
    let { customUtil, uniID, config, pubFun, vk, db, _, $ } = util;
    let { uid, _id } = data;
    // 业务逻辑开始-----------------------------------------------------------
    if (!_id)
      return {
        code: -1,
        msg: "缺少分类_id",
      };
    const res = await vk.baseDao.deleteById({
      dbName: "dfb-classification",
      id: _id,
    });

    if (!res) {
      return {
        code: -1,
        msg: "删除失败",
      };
    }
    // 业务逻辑结束-----------------------------------------------------------
    return {
      code: 0,
      msg: "删除成功",
    };
  },
};
